cmake_minimum_required( VERSION 3.10 )

project(maix_mediactrl)

SET( CMAKE_C_COMPILER arm-openwrt-linux-gcc)
SET( CMAKE_CXX_COMPILER arm-openwrt-linux-g++)

SET( CMAKE_VERBOSE_MAKEFILE OFF )

SET( SRC ./src/main.cpp
         ./src/mediactrl.cpp
         ./src/capture/capture.cpp
         ./src/encoder/encoder.cpp
         ./src/display/display.cpp
         ./src/base/video_base.cpp
         ./src/base/video_memory.cpp
         ./src/base/memory_pool.cpp
         ./src/rtsp/rtsp_service.cpp
         ./src/rtsp/rtsp_h264liveSource.cpp
         ./src/rtsp/rtsp_h264liveSMS.cpp
         ./src/rtsp/rtsp_interface.cpp ) #添加源文件


include_directories( ./inc/
                     ./inc/capture/
                     ./inc/base/
                     ./inc/encoder/
                     ./inc/display/
                     ./inc/rtsp/
                     ./components/libmaix/include
                     ./components/live555/inc/BasicUsageEnvironment/include/
                     ./components/live555/inc/groupsock/include/
                     ./components/live555/inc/liveMedia/include/
                     ./components/live555/inc/UsageEnvironment/include/
                     ./components/ssl/inc/) #添加头文件

add_executable( ${PROJECT_NAME} ${SRC} )

target_link_libraries( ${PROJECT_NAME} pthread )
target_link_libraries( ${PROJECT_NAME}  -L../components/libmaix/lib/arch/v831/
                                        libmaix_nn.so
                                        libISP.so
                                        libcdc_base.so
                                        libvencoder.so
                                        libion.so
                                        libglog.so.0.3.5
                                        liblog.so
                                        libVE.so
                                        libisp_ini.so
                                        libmedia_utils.so
                                        libMemAdapter.so
                                        libmpp_isp.so
                                        libmpp_vi.so
                                        libmpp_mini.so
                                        libmaix_cam.so
                                        libmaix_disp.so
                                        libmaix_image.so
                                        libmaix_utils.so
                                        )

target_link_libraries( ${PROJECT_NAME} -L../components/live555/lib/
                                        libliveMedia.a
                                        libgroupsock.a
                                        libBasicUsageEnvironment.a
                                        libUsageEnvironment.a
                                        )

target_link_libraries( ${PROJECT_NAME} -L../components/ssl/lib/
                                        libssl.a
                                        libcrypto.a
                                        )

# add_custom_command(install ${PROJECT_NAME}
#     PRE_BUILD
#     COMMAND odb -o /home/david/dev/ --std c++11 -I/home/david/dev/ -d sqlite --generate-    query --generate-schema ${PROMOTER_LIB_PREFIX}/entities/person.hpp
#     DEPENDS ${PROJECT_NAME}
#     VERBATIM
# )